{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->

<style type="text/css">
    body{
    	padding-top:2.2rem;
    }
</style>
{/block}
{block name="content"}
{include file="../common_header.html"}
<form>
<ul class="visit_from">
    <li class="clearfix">
        <label for="yin" class="fl">真实姓名</label>
        <input type="text" id="yin" name="user_name" value="" placeholder="请输入真是姓名">
    </li>
    <li class="clearfix">
        <label for="tell" class="fl">手机号码</label>
        <input type="number" id="tell" name="mobile" value="" placeholder="请输入手机号码">
    </li>
    <li class="clearfix">
        <label for="name" class="fl">公司名称</label>
        <input type="text" id="name" name="company_name" value="" placeholder="请输入公司名称">
    </li>
</ul>
<h6 class="bei">申请服务描述</h6>
<textarea name="service_sketch" placeholder="请输入申请服务描述" class="bei_txt"></textarea>
<h6 class="bei">备注</h6>
<textarea name="remark" placeholder="请输入备注" class="bei_txt"></textarea>
    <input type="hidden" name="service_providers_id" value="{$service_providers_id}">
    <input type="hidden" name="service_type_id" value="{$service_type_id}">
</form>
<div class="submit_btn">提交</div>
{/block}
{block name="js"}
{literal}
<!-- <script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js"></script> -->
<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/circle.js"></script>
        <script type="text/javascript">
                /*$(window).load(function() {
                });*/
            $(function()
            {
//                $(".service_header i,.service_header span").on("click",function()
//                {
//                    history.go(-1);
//                });
                $(".submit_btn").on("click",function()
                {
                    if($("#yin").val()=='')
                    {
                        layer.open({
                            content: '请输入姓名',
                            title: false,
                            btn: ['确定'],
                        });
                        return;
                    }
                    if($("#tell").val()=='')
                    {
                        layer.open({
                            content: '请输入手机号码',
                            title: false,
                            btn: ['确定'],
                        });
                        return;
                    }
                    if($("#name").val()=='')
                {
                    layer.open({
                        content: '请输入公司名称',
                        title: false,
                        btn: ['确定'],
                    });
                    return;
                }
                    $.ajax({
                        type : 'POST',
                        url : '/FrontService/apply_service',
                        data :$('form').serialize(),
                        success:function (data) {
                            if(data.status ==0){
                                layer.open({
                                    content: data.msg,
                                    title: false,
                                    btn: ['确定'],
                                    yes:function(){
                                        if(!is_wechat()){
                                            native_listen('back');
                                        }else{
                                            history.go(-1);
                                        }
                                    }
                                });
                             //   history.go(-1);
                            }else{
//                                console.log(data.msg);
                                layer.open({
                                    content: data.msg,
                                    title: false,
                                    btn: ['确定']
                                });
                            }
                        }
                    })
                });
            });
        </script>
{/literal}
{/block}